package edu.poly.game.battleship;

public enum Orientation {
	VERTICLE("V"), HORIZONTAL("H");
	
	private String name;
	
	private Orientation(final String name) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	public static Orientation getOrientation(final String name) {
		//short hand for not checking null value, will not throw NullPointerException
		if("V".equalsIgnoreCase(name)) {
			return VERTICLE;
		} else if ("H".equalsIgnoreCase(name)) {
			return HORIZONTAL;
		} else {
			return VERTICLE;
		}
	}
}
